<template>
  <div class="home">
    <div class="showStyle" v-if="Object.keys(info).length > 0">
      <!-- 返回 -->
        <div class="back">
          <div class="myback"><img src="../../../../../img/back.png" alt=""/></div>
          <button @click="go">
            {{ $t('back') }}
          </button>
        </div>
        <div class="showList">
          <div class="picli">
            
            <div class="mypicimg"  v-for="(item,index) in info[$store.state.language].pic" :key="index"><img class="img" :src="item" alt=""></div>
          </div>
          
            <!-- <div class="myimg"><img class="img" :src="info[$store.state.language].pic" alt=""></div> -->
            <!-- <div class="myimg" :style="{ 'background-image':`url(${info[$store.state.language].pic})` }"></div> -->
            <p class="title">{{ info[$store.state.language].name }}</p>
            <p class="author">{{ info[$store.state.language].artist }}</p>
            <p class="kind">{{ info[$store.state.language].material }}</p>
            <p class="size">{{ info[$store.state.language].size }}</p>
            <div class="brief">
              <p v-html="info[$store.state.language].brief"></p>
              
              <!-- <p>{{ info[$store.state.language].brief }}</p> -->
            </div>
        </div>
    </div>
    
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: {}
    };
  },
  methods: {
    go: function() {
      this.$router.go(-1); //返回上一页
    },
    getDetail(id) {
      this.$http
        .get("/artworksOne", {
          params: {
            id: id
          }
        })
        .then(response => {
          this.info = response.data;
          // console.log(this.info[this.$store.state.language].pic);
          console.log(this.info);
        })
        .catch(function(response) {
          console.log(response);
        });
    }
  },
  created() {
    this.getDetail(this.$route.params.id);
  }
};
</script>
<style lang="scss" scoped>
.ignore {
  border-bottom: 1px solid black;
}
.home {
  width: 100%;
  display: flex;
  flex-flow: column;
  .bottom {
    width: 100%;
    position: relative;
    top: 8vh;
    img {
      width: 100%;
      height: auto;
    }
    ul {
      font-size: 22px;
      li {
        height: 38.8px;
        line-height: 38.8px;
        list-style-type: none;

        position: relative;
        left: -24px;
        top: -6px;
        a {
          text-decoration: none;
          color: black;
        }
      }
    }
  }
  .showStyle {
    width: 100%;
    position: relative;
    // top: 53px;
    .back {
      height: 40px;
      width: 100%;
      position: fixed;
      background-color: white;
      top: 8vh;
      // line-height: 30px;
      display: flex;
      flex-flow: wrap;
      align-items: center;
      .myback {
        width: 15px;
        height: 15px;
        // line-height: 15px;
        margin-left: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 100%;
          height: 100%;
        }
      }

      button {
        font-size: 12px;
        border: 0;
        background: white;
        padding: 0 0 0 0px;
        font-weight: bolder;
        // width: 25px;
        height: 15px;
        // line-height: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .showList {
      display: flex;
      flex-flow: column;
      justify-content: center;
      align-items: center;
      .picli {
        width: 345px;
        height: auto;
        margin-top: 35px;
        .myimg {
          width: 345px;
          height: auto;
          // margin-top: 8vh;
          // margin-top: 39px;
          // background-repeat: no-repeat !important;
          // background-position: center center !important;
          // background-size: cover !important;
          // height: 230px;
          img {
            width: 100%;
            height: 100%;
          }
        }
      }

      .title {
        width: 345px;
        // font-size: 14px;
        margin: 15px 0 0 0;
        font-weight: bold;
        font-size: 20px;
        line-height: 25px;
      }
      .author {
        width: 345px;
        // font-size: 13px;
        margin: 10px 0 0 0;
        font-size: 14px;
        line-height: 22px;
      }
      .kind {
        width: 345px;
        // font-size: 12px;
        margin: 3px 0 0 0;
        font-size: 15px;
        line-height: 22px;
      }
      .size {
        width: 345px;
        // font-size: 12px;
        margin: 3px 0 0 0;
        font-size: 15px;
        line-height: 22px;
      }
      .brief {
        width: 345px;
        // font-size: 12px;
        margin: -5px 0 15px 0;
        font-size: 15px;
        line-height: 22px;
        // text-align: justify;
        // text-justify: inter-character;
      }
    }
  }
}
</style>

